package com.ylr.admin.framework.mapper;

import com.ylr.admin.framework.entity.DeptEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * Created by IntelliJ IDEA.
 *
 * @author wyw
 * date: 2023-04-21 11:27:23
 * className: DeptMapper
 * version: 1.0
 * description:
 */
public interface DeptMapper extends BaseMapper<DeptEntity> {

    /**
     * 查询子部门的最大排序等级
     * @param parentId     父级主键
     * @param deleteStatus 删除状态
     * @return 最大排序等级数值
     */
    Integer selectMaxSort(@Param("parentId") Long parentId, @Param("deleteStatus") Integer deleteStatus);

    /**
     * 查询子部门
     * @param path         部门路径
     * @param deleteStatus 删除状态
     * @return 部门列表
     */
    List<DeptEntity> selectChildrenList(@Param("path") String path, @Param("deleteStatus") Integer deleteStatus);
}
